/*  1:   */ package org.jetbrains.generate.tostring.element;
/*  2:   */ 
/*  3:   */

import com.intellij.psi.PsiField;
import com.intellij.psi.PsiMember;
import com.intellij.psi.PsiMethod;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */ 
/* 10:   */ public class ElementUtils
/* 11:   */ {
/* 12:   */   public static List<FieldElement> getOnlyAsFieldElements(Collection<PsiMember> paramCollection)
/* 13:   */   {
/* 14:40 */     ArrayList localArrayList = new ArrayList();
/* 15:42 */     for (PsiMember localPsiMember : paramCollection) {
/* 16:43 */       if ((localPsiMember instanceof PsiField))
/* 17:   */       {
/* 18:44 */         PsiField localPsiField = (PsiField)localPsiMember;
/* 19:45 */         FieldElement localFieldElement = ElementFactory.newFieldElement(localPsiField);
/* 20:46 */         localArrayList.add(localFieldElement);
/* 21:   */       }
/* 22:   */     }
/* 23:50 */     return localArrayList;
/* 24:   */   }
/* 25:   */   
/* 26:   */   public static List<MethodElement> getOnlyAsMethodElements(Collection<PsiMember> paramCollection)
/* 27:   */   {
/* 28:60 */     ArrayList localArrayList = new ArrayList();
/* 29:62 */     for (PsiMember localPsiMember : paramCollection) {
/* 30:63 */       if ((localPsiMember instanceof PsiMethod))
/* 31:   */       {
/* 32:64 */         PsiMethod localPsiMethod = (PsiMethod)localPsiMember;
/* 33:65 */         MethodElement localMethodElement = ElementFactory.newMethodElement(localPsiMethod);
/* 34:66 */         localArrayList.add(localMethodElement);
/* 35:   */       }
/* 36:   */     }
/* 37:70 */     return localArrayList;
/* 38:   */   }
/* 39:   */   
/* 40:   */   public static List<Element> getOnlyAsFieldAndMethodElements(Collection<PsiMember> paramCollection)
/* 41:   */   {
/* 42:80 */     ArrayList localArrayList = new ArrayList();
/* 43:82 */     for (PsiMember localPsiMember : paramCollection)
/* 44:   */     {
/* 45:   */       Object localObject1;
/* 46:   */       Object localObject2;
/* 47:83 */       if ((localPsiMember instanceof PsiField))
/* 48:   */       {
/* 49:84 */         localObject1 = (PsiField)localPsiMember;
/* 50:85 */         localObject2 = ElementFactory.newFieldElement((PsiField)localObject1);
/* 51:86 */         localArrayList.add(localObject2);
/* 52:   */       }
/* 53:87 */       else if ((localPsiMember instanceof PsiMethod))
/* 54:   */       {
/* 55:88 */         localObject1 = (PsiMethod)localPsiMember;
/* 56:89 */         localObject2 = ElementFactory.newMethodElement((PsiMethod)localObject1);
/* 57:90 */         localArrayList.add(localObject2);
/* 58:   */       }
/* 59:   */     }
/* 60:93 */     return localArrayList;
/* 61:   */   }
/* 62:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.generate.tostring.element.ElementUtils

 * JD-Core Version:    0.7.0.1

 */